package cn.edu.xmu.oomall.order.microservice;

import cn.edu.xmu.oomall.core.config.OpenFeignConfig;
import cn.edu.xmu.oomall.order.constant.TimeFormat;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.ZonedDateTime;

@FeignClient(name = "activity-service", configuration = OpenFeignConfig.class)
public interface AdvanceSaleService {

    /** 查询所有上线的预售活动**/
    @GetMapping(value = "/advancesales")
    InternalReturnObject queryAllOnlineAdvanceSales(
            @RequestParam(name = "shopId", required = false) Long shopId,
            @RequestParam(name = "productId", required = false) Long productId,
            @RequestParam(required = false) @DateTimeFormat(pattern = TimeFormat.INPUT_DATE_TIME_FORMAT) ZonedDateTime beginTime,
            @RequestParam(required = false) @DateTimeFormat(pattern = TimeFormat.INPUT_DATE_TIME_FORMAT) ZonedDateTime endTime,
            @RequestParam(name = "page", required = false) Integer page,
            @RequestParam(name = "pageSize",  required = false) Integer pageSize);
}
